<#assign display=JspTaglibs["/WEB-INF/tlds/displaytag.tld"]/>
<html>
<#include "../common/adminHeaderInclude.ftl">
<div>
    <a href="viewAll.htm"><@spring.message "entity.viewAll"/></a>
</div>
<#include "../common/showGlobalErrorMessages.ftl">
<div class="marginTop infoBox">
    <table>
        <tbody>
        <tr>
            <th><@spring.message "teeTime.maxParticipants"/>:</th>
            <td>${entity.teeTime.maxParticipants}</td>
        </tr>
        <tr>
            <th><@spring.message "teeTime"/>:</th>
            <td>${entity.teeTime.teeTime?datetime}</td>
        </tr>
        <tr>
            <th><@spring.message "course"/>:</th>
            <td>${entity.teeTime.course.guiDescription}</td>
        </tr>
        </tbody>
    </table>
</div>
<h2><@spring.message "player.players"/></h2>

<div class="marginTop">
<@display.table name="entity.teeTime.rounds" id="entity" pagesize=30 class="listingTable">
<@display.column titleKey="player" property="player.guiDescription" sortable=true/>
<@display.column title="teeColour" property="teeColour"/>
<@display.column title="round.slopeHandicap" property="slopeHandicap"/>
<@display.column title="round.totalScore" property="totalScore"/>
<@display.column title="round.netScore" property="totalNetScore"/>
</@display.table>
</div>
<#if entity.teeTime.fullyBooked>
    <div class="marginTop infoBox">
        The tee time is fully booked, no more player can be added
    </div>
    <#else>
        <form action="save.htm" method="POST">
            <div class="marginTop infoBox">
                <table>
                    <tbody>
                    <tr>
                        <td class="formRowLabel"><@spring.message "player"/>*:</td>
                        <td><@spring.formSingleSelect "entity.player", allPlayers/></td>
                        <td><@spring.showErrors "<br>"/></td>
                    </tr>
                    <tr>
                        <td class="formRowLabel"><@spring.message "teeColour"/>*:</td>
                        <td><@spring.formSingleSelect "entity.teeColour", allTeeColours/></td>
                        <td><@spring.showErrors "<br>"/></td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <input type="submit" value="<@spring.message "entity.save"/>"/>
                        </td>
                    </tr>
                </table>
            </div>
        </form>
</#if>


</body>
</html>